import { type Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { AntdTheme } from '@pzy915/vite-plugin-vitepress-demo/theme'
import 'animate.css'
import './customLayer.css'
import './global.scss'
import { imgClick } from './imageTouchScale'

// 引入swiper
import { Swiper, SwiperSlide } from 'swiper/vue'
import 'swiper/css'

import './tailwind.css'

import Vue3TouchEvents, { type Vue3TouchEventsOptions } from 'vue3-touch-events'

export default {
  ...DefaultTheme,
  //   NotFound: () => 'custom 404', // <- this is a Vue 3 functional component
  enhanceApp({ app, router, siteData }) {
    // app is the Vue 3 app instance from `createApp()`. router is VitePress'
    // app.use(animated)
    app.use(ElementPlus)
    app.component('Swiper', Swiper)
    app.component('SwiperSlide', SwiperSlide)
    app.component('Demo', AntdTheme)
    // custom router. `siteData`` is a `ref`` of current site-level metadata.
    imgClick()
    app.use<Vue3TouchEventsOptions>(Vue3TouchEvents, {
      disableClick: false,
    })
  },
  setup() {},
} as Theme
